﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;

namespace ENG.EngStartQueue.Counters
{
  internal class CultureCounter
  {
    public string Language { get; private set; }
    public string Name { get; private set; }
    public string Info { get; private set; }
    public List<CultureCounterData> Counters { get; private set; }

    internal static CultureCounter Load(System.Xml.Linq.XElement item)
    {
      CultureCounter ret = new CultureCounter();

      ret.Language = Root.GetAttribute(item, "cultureTag");
      ret.Name = Root.GetAttribute(item, "name");
      ret.Info = Root.GetAttribute(item, "info");
      ret.Counters = new List<CultureCounterData>();
      CultureCounterData d = null;

      foreach (XElement fItem in item.Elements())
      {
        d = CultureCounterData.Load(fItem);

        ret.Counters.Add(d);
      } // foreach (XElement fItem in fItem.Elements())

      return ret;
    }
  }
}
